package cn.uin.domain.auth.model.valobj;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * @ClassName RegisterTypeEnum
 * @Description:注册方式枚举
 * @Author: Administrator
 * @CreateDate: 2025/10/22 9:46
 * @Version: 1.0
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum RegisterTypeEnum {

	PWD(1, "PwdRegister"), //用户名密码
	EMAIL(2, "EmailRegister"), //邮箱
	PHONE(3, "PhoneRegister"); //手机号

	private Integer code;
	private String info;

	public static RegisterTypeEnum get(Integer code) {
		switch (code) {
			case 1:
				return PWD;
			case 2:
				return EMAIL;
			case 3:
				return PHONE;
			default:
				throw new RuntimeException("err code!");
		}
	}

}
